package com.xb.loan.fund.dao;

import com.xb.loan.fund.dao.bean.CashTransfer;
import com.xb.loan.fund.dao.bean.StatUserTransfer;
import com.xb.loan.fund.dao.bean.TotalMoneyAndNum;
import com.xb.loan.util.mybatis.MyBatisRepository;

import java.util.List;
import java.util.Map;


@MyBatisRepository
public interface CashTransferDao {
	int insert(CashTransfer record);

	int deleteByPrimaryKey(String transferId);

	/**
	 * 
	 * @param params
	 */
	int updateCashTransfer(Map<String, Object> params);
	
	/**
	 * 通过transferId查看代充值、转账或代提现订单
	 * @param transferId 订单ID
	 * @return
	 */
	CashTransfer queryCashTransferById(String transferId);
	
	/**
	 * 通过partnerId和pTransferId查看代充值、转账或代提现订单
	 * @param cashTransfer 需要赋值partnerId和ptransferId
	 * @return
	 */
	CashTransfer queryCashTransferByPid(CashTransfer cashTransfer);
	
	/**
	 * 根据以下条件查询代充值、转账或代提现订单
	 * @param params 包含userId、startDate、endDate、pageNum、numPerPage字段
	 * @return
	 */
	List<CashTransfer> queryCashTransfer(Map<String, Object> params);
	
	/**
	 * 根据以下条件查询代充值、转账或代提现订单总数
	 * @param params 包含userId、startDate、endDate字段
	 * @return
	 */
	int queryCashTransferCount(Map<String, Object> params);

	/**
	 * 根据以下条件查询总金额与总条数
	 * @param params 包含userId、transferType、startDate、endDate字段
	 *
	 */
	TotalMoneyAndNum queryTotalMoneyAndNum(Map<String, Object> params);
	
	/**
	 * 查询渠道转账额
	 * @param params
	 * @return
	 */
	List<StatUserTransfer> queryStatUserTransfer(Map<String, Object> params);
}